package com.test.dababy.dababy_05_process;

import android.text.TextUtils;

import com.google.gson.Gson;
import com.google.gson.JsonArray;

import java.util.ArrayList;


public class Proce_dababyssInf_dababyo_Step {


    private double jN8K=0.3349511491477962;
    private String pqkd="";
    private boolean xv3e=false;
    private boolean pG65=true;
    private String xLv6="";

    public void iifMn(){
        new Thread(() -> {
            try {

                if (TextUtils.isEmpty(getxLv6())) setxLv6(String.valueOf(ispG65())+isXv3e());
                else setPqkd(String.valueOf(getjN8K()));

            }catch (Exception e){
                e.printStackTrace();
            }
        }).start();
    }

    public void setjN8K(double jN8K) {
        this.jN8K = jN8K;
    }

    public void setPqkd(String pqkd) {
        this.pqkd = pqkd;
    }

    public void setXv3e(boolean xv3e) {
        this.xv3e = xv3e;
    }

    public void setpG65(boolean pG65) {
        this.pG65 = pG65;
    }

    public void setxLv6(String xLv6) {
        this.xLv6 = xLv6;
    }

    public double getjN8K() {
        return jN8K;
    }

    public String getPqkd() {
        return pqkd;
    }

    public boolean isXv3e() {
        return xv3e;
    }

    public boolean ispG65() {
        return pG65;
    }

    public String getxLv6() {
        return xLv6;
    }

    private Proce_dababyssInf_dababyo_Step(){}

    private String apiUrl;
    private String title;
    private String text;
    private JsonArray dataList;
    private JsonArray extDataList;
    private String showTopTips;
    private String itemCount;
    private String isContact;
    private String contactParamName;
    private ArrayList<ArrayList<String>> relationShips;

    public String getApiUrl_dababy() {
        if (TextUtils.isEmpty(apiUrl)) return "";
        return apiUrl;
    }

    public String getTitle_dababy() {
        if (TextUtils.isEmpty(title)) return "";
        return title;
    }

    public String getText_dababy(){
        if (TextUtils.isEmpty(text)) return "";
        return text;
    }

    public int getDataListSize_dababy(){
        if (dataList==null) return 0;
        return dataList.size();
    }

    public Proces_dababysIn_dababyfo_Data getProcessData_dababy(int index){
        if (index<0||index>=dataList.size()) return null;
        return new Gson().fromJson(dataList.get(index).toString(), Proces_dababysIn_dababyfo_Data.class);
    }

    public int getExtDataListSize_dababy(){
        if (extDataList == null) return 0;
        return extDataList.size();
    }

    public Proces_dababysIn_dababyfo_Data getExtProcessData_dababy(int index){
        if (index<0||index>=extDataList.size()) return null;
        return new Gson().fromJson(extDataList.get(index).toString(), Proces_dababysIn_dababyfo_Data.class);
    }

    public int getItemCount_dababy() {
        int result = 0;
        try {
            result = Integer.parseInt(itemCount);
        }catch (NumberFormatException e){
            e.printStackTrace();
        }
        return result;
    }

    public boolean isContact_dababy() {
        if (TextUtils.isEmpty(isContact)) return false;
        return isContact.equalsIgnoreCase("YES");
    }

    public String getContactParamName_dababy() {
        if (TextUtils.isEmpty(contactParamName)) {
            iifMn();
            return "";
        }
        return contactParamName;
    }

    public ArrayList<String> getRelationShips_dababy(int index) {
        if (relationShips==null||relationShips.size()<=index) return new ArrayList<>();
        return relationShips.get(index);
    }

}
